package com.lin.controller;


import com.lin.base.Result;
import com.lin.entity.WarningLog;
import com.lin.entity.WarningLogReq;
import com.lin.mapper.WarningLogMapper;
import com.lin.service.impl.WarningLogServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lin
 * @since 2022-06-17
 */
@RestController
@RequestMapping("api/log/warning")
public class WarningLogController {
    @Resource
    WarningLogServiceImpl warningLogService;

    @GetMapping("/list")
    public Result getWarningLogList(WarningLogReq warningLogReq){
       return Result.ok(warningLogService.getWarningLogList(warningLogReq));
    }

    @PostMapping("/sendMsg")
    public Result sendMsg(@RequestParam("departmentName") String departmentName) {
        //todo：待添加条件查询
        System.out.println("departmentName: " + departmentName);
        return warningLogService.sendMsgToPhone(departmentName);
    }

}
